package com.qding.config.mongo;

import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.baidu.disconf.client.common.annotations.DisconfFile;
import com.baidu.disconf.client.common.annotations.DisconfFileItem;
import com.qding.config.MyDisconfDataGetter;

/**
 * @author Administrator mongo 数据连接池配置
 */
@Service
@Configuration
@Scope("singleton")
@DisconfFile(filename = MyDisconfDataGetter.mongo_datasource_properties)
public class MongoDatasourceConfig {

	/**
	 * mongo  数据库地址
	 */
	private String host;
	
	/**
	 * mongo  端口
	 */
	private int port;
	
	/**
	 * 默认的数据名
	 */
	private String databaseName="parkstop";
	
	@DisconfFileItem(name = "host",associateField ="host")
	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}
	
	@DisconfFileItem(name = "port",associateField ="port")
	public int getPort() {
		return port;
	}

	public void setPort(int port) {
		this.port = port;
	}
	
	@DisconfFileItem(name = "databaseName",associateField ="databaseName")
	public String getDatabaseName() {
		return databaseName;
	}

	public void setDatabaseName(String databaseName) {
		this.databaseName = databaseName;
	}

	@Override
	public String toString() {
		return "MongoDatasourceConfig [host=" + host + ", port=" + port + ", databaseName=" + databaseName + "]";
	}
	
	
	
}
